home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
MacHack 1993
/
MacHack 1993.toast
/
MacHack™ 1987-1992
/
MacHack™ '92
/
Hacks ’92
/
RISCy Bitsness
/
cpu2
/
regfile.v
< prev
next >
Encoding:
Amiga
Atari
Commodore
DOS
FM Towns/JPY
Macintosh
Macintosh JP
Macintosh to JP
NeXTSTEP
RISC OS/Acorn
Shift JIS
UTF-8
Wrap
Verilog source code
|
1992-06-18
|
369 b
|
23 lines
|
[
TEXT/MPS
]
module regfile(clock, in_addr, in,
out1_addr, out1,
out2_addr, out2);
input clock;
input [31: 0]in;
input [ 4: 0]in_addr,
out1_addr,
out2_addr;
output [31: 0]out1,
out2;
reg [31: 0]r[32];
assign out1 = r[out1_addr];
assign out2 = r[out2_addr];
always @(negedge clock)
r[in_addr] = in;
endmodule